function JM_average = cal_JM_average(class_info)
    % 初始化变量以存储JM距离总和和计数器
    jm_sum = 0;
    count = 0;
    % 获取类别的总数
    num_classes = length(class_info.class);
    % 遍历所有可能的类别组合
    for i = 1:num_classes-1
        for j = i+1:num_classes
            % 计算当前类别组合的JM距离
            jm_distance = cal_JM_distance(class_info.class{i}.class_data, class_info.class{j}.class_data);
            % 累加到总和中
            jm_sum = jm_sum + jm_distance;
            % 计数器加一
            count = count + 1;
        end
    end
    % 计算JM距离的平均值
    if count > 0
        JM_average = jm_sum / count;
    else
        JM_average = 0; % 如果没有类别组合，则返回0
    end

end